package Model;
import java.util.ArrayList;


/**
 * this class handles a list of Vare. 
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class VareContainer
{
    
    private ArrayList<Vare> varelist;

    /**
     * Constructor for objects of class VareContainer
     */
    public VareContainer()
    {
       varelist = new ArrayList<Vare>();
    }
    
   
    /**
     * this method can find a Vare object
     * 
     * @param VareNr
     * @return nothing
     */
    public Vare findVare(int vareNr)
    {
        int index = 0;
        while(varelist.size() > index)
        {
            Vare vare = varelist.get(index);
            if(vare.getVareNr() == (vareNr))
            {
                return vare;
            }
            index++;
        }
        return null;
    }
    
    
    /**
     * this method can remove a Vare object from the list
     * 
     * @param vareNr
     * @return nothing
     */
    public void removeVare(int vareNr)
    {
        varelist.remove(findVare(vareNr));    
    }
    
    /**
     * this method can add a created Vare object to the list
     * 
     * @param varelist
     * @return nothing
     */
    public void addVare(Vare varelist)
    {
        this.varelist.add(varelist);
    }
    
    
        
}
